using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

/**
*@file       GBServer_NotifyReciever.cs
*@brief      process message GBServer_Notify
*
*@author     graywind
*@version    1.0.0.1
*@data       2012/3/26
*/

//process GBServer_Notify
public class OnGBServer_Notify
{
    /// <summary>
    /// process message
    /// </summary>
    /// <param name="op">message operator</param>
    /// <param name="session_id">session identifier</param>
    /// <param name="msg_buffer">message buffer</param>
    /// <param name="msg_bytes">buffer length</param>
    public static void OnMapping(IMessageOperator op, Int32 session_id, byte[] msg_buffer, UInt32 msg_bytes)
    {
        //TODO
		global.ServerNotify sn = ProtoNet<global.ServerNotify>.CreateFromBytes(msg_buffer, msg_bytes);

        if (sn.ServerType == global.eServerType.ServerType_GatewayServer)
        {
            op.RegisterToGateway(session_id);
        }
    }
}

//register callback
partial class MessageProcTypes<ProcType, MessageProc>
{
        [MessageProcType((int)GlobalTypes.MessageType.GBServer_Notify)]
        public static GlobalProcessor.GlobalTabFunc GBServer_NotifyProc = new GlobalProcessor.GlobalTabFunc(OnGBServer_Notify.OnMapping);
}
